Repository navigation
P18 phase 1: one console and Stop (IDE and embed, protocol v4) - #29
Merged
Merged
Conversation
Stop: while Python is busy for more than 300 ms (a program, a REPL input,
Tests, a visualization) the run button becomes «■ Stoppen». Stopping ends
the worker and starts a new one: the code stays, the console keeps what
was printed and says that Python restarted. Hosts can stop through the
command { type: 'stop' } and learn about busy through onBusyChange; the
embed passes both on to its parent as protocol version 4
(glpython:stop, glpython:busy, capabilities.stop).
One console («Konsole»): the program's output, REPL inputs, Tests reports
and notes form one chronological transcript; a Tests report is appended
instead of replacing it. Output streams while a program or REPL input runs
(at most 50 messages per 50 ms, shown every 40 ms), so an endless loop shows
what it prints. The console keeps the last 100,000 characters, follows new
output unless scrolled up, and in the embed grows up to 480px.
A REPL input before any Run (e.g. right after a stop) failed with
"No module named 'gturtle'": "/" was only put on sys.path by a Run.
session.py now adds it when it loads.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… stays Starting with Enter and stopping with Enter again kept failing: the button was swapped for another element, and disabled in the 300 ms before Stop shows, and either drops keyboard focus. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Added: Run and Stop are now one button that is never disabled ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 1 of P18 (spec: teaching-agent
journal.md→ Visual Identity → «glpython-IDE (Hülle um den Editor)»): behaviour in the IDE and the embed.Stop
endlos(), Tests or a visualization. The 300 ms delay keeps quick REPL inputs from making the button flicker.command: { type: 'stop' }and the newonBusyChangeprop.setInterruptBuffer→KeyboardInterrupt, keeping the namespace). It is not possible in LiaScript's embed, where the iframe isn't isolated. I kept one behaviour everywhere, the restart, and list the interrupt as a follow-up.Embed protocol version 4
glpython:stop(parent → embed).glpython:busy{busy}(embed → parent), only to parents that speak version 4.capabilities.stopinglpython:ready.busy: false.check-embed-protocol.mjscovers version 4.embed/demo.html's Run becomes Stop while busy.One console («Konsole»)
A bug fixed on the way
A REPL input before any Run (now also right after a stop) failed with
ModuleNotFoundError: No module named 'gturtle', because only a Run put/onsys.path.session.pyadds it when it loads.Tested
In the built embed via its protocol, and in the IDE with this build (laptop 1440 and iPad 820 widths):
while True:printing every 200,000busy: true; Stop → note,busy: falsezahl→NameError+ hint «Wurde die Datei schon ausgeführt?»;1 + 1→2endlos()in the REPL>>> quadrat(4)lint(known warning only), both builds,test:protocol,test:runtimeandtest:hintspass. Screenshots are in the phase report.🤖 Generated with Claude Code